package models.rbac;

import play.*;
import play.db.jpa.*;

import javax.persistence.*;
import java.util.*;

/**
 * 授权
 * @author justin
 *
 */
@Entity
public class Privilege extends Model {
    
	@ManyToOne
	public Resource resource;
	
	@ManyToOne
	public Operation operation;
	
	@ManyToMany
	public List<Role> roles;

	@Override
	public String toString() {
		return "Privilege [resource=" + resource.name + ", operation=" + operation.name
				+ "]";
	}
	
}
